예제 #1
0
        public PerkScript MakeCopyOnGameObject(GameObject target)
        {
            PerkScript script = target.AddComponent(GetType()) as PerkScript;

            CopyFieldsTo(script);
            return(script);
        }
예제 #2
0
        void OnPerkGiven(PerksContainer container)
        {
            for (int i = 0; i < perk.perkBehaviors.Length; i++)
            {
                perk.perkBehaviors[i].OnPerkGiven(container, perk);
            }

            for (int i = 0; i < perk.perkScripts.Length; i++)
            {
                PerkScript scriptInstance = perk.perkScripts[i].MakeCopyOnGameObject(container.gameObject);
                scriptInstance.OnPerkGiven(perk);
                perkScripts.Add(scriptInstance);
            }
        }
예제 #3
0
 protected abstract void CopyFieldsTo(PerkScript target);