Exemple #1
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            heroKitObject = hko;
            bool getThisBool = BoolFieldValue.GetValueB(heroKitObject, 0);

            BoolFieldValue.SetValueB(heroKitObject, 0, !getThisBool);

            // show debug message
            if (heroKitObject.debugHeroObject)
            {
                string debugMessage = "Bool: " + getThisBool;
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject, debugMessage));
            }

            return(-99);
        }
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            heroKitObject = hko;
            HeroObject heroObject    = HeroObjectFieldValue.GetValueC(heroKitObject, 0);
            bool       getThisObject = false;
            bool       runThis       = (heroObject != null);

            if (runThis)
            {
                getThisObject = BoolFieldValue.GetValueC(heroKitObject, 1, heroObject);
                BoolFieldValue.SetValueB(heroKitObject, 2, getThisObject);
            }

            // show debug message
            if (heroKitObject.debugHeroObject)
            {
                string debugMessage = "Bool: " + getThisObject;
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject, debugMessage));
            }

            return(-99);
        }
 // Execute the action on a target hero game object
 public void ExecuteOnTarget(HeroKitObject targetObject, bool boolValue)
 {
     // replace this with your fields
     BoolFieldValue.SetValueB(targetObject, 2, boolValue);
 }