Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- #if UNITY_EDITOR
- using UnityEditor;
- #endif
- namespace RPGSystem{
- public class Coins : Float {
- public CrossSceneReference target;
- public override float GetResult()
- {
- MovementController c=null;
- if(target!=null)
- {
- if(target.obj!=null){
- c= target.obj.GetComponent<MovementController>();
- }
- }else{
- c= parent.controller;
- }
- if(c!=null)
- {
- return c.inv.coins;
- }
- return 0;
- }
- #if UNITY_EDITOR
- protected override void DrawAdditionalFields()
- {
- target = (CrossSceneReference)EditorGUILayout.ObjectField("Target", target, typeof(CrossSceneReference), true);
- }
- #endif
- public override string Type()
- {
- return "Coins";
- }
- public override void CopyTo(Node other)
- {
- Coins temp = other as Coins;
- temp.target = target;
- base.CopyTo(other);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment