Exemple #1
0
        public void ExecuteOnTarget(HeroKitObject targetObject, bool changePrefab, GameObject prefab,
                                    bool changeRigidbody, Rigidbody rigidbody,
                                    bool changeVisual, int isHidden)
        {
            if (changePrefab)
            {
                HeroKitCommonRuntime.AddPrefab(targetObject.gameObject, prefab, false, HeroKitCommonRuntime.visualsName);
            }

            if (changeRigidbody)
            {
                HeroKitCommonRuntime.AddRigidbody(rigidbody, targetObject.gameObject);
            }

            if (changeVisual)
            {
                GameObject visuals = HeroKitCommonRuntime.GetVisualsGameObject(targetObject.gameObject);

                // show visuals
                if (isHidden == 1)
                {
                    HeroKitCommonRuntime.toggleRenderer(visuals.transform, true);
                }
                // hide visuals
                else if (isHidden == 2)
                {
                    HeroKitCommonRuntime.toggleRenderer(visuals.transform, false);
                }
            }
        }