public void SetCharacterControllerAsAI(AIFighterData profile = null) { SideScrollerAIController newControl = gameObject.AddComponent(typeof(SideScrollerAIController)) as SideScrollerAIController; newControl.SetPlayerID(playerNumber); // Config AI Profile if (profile) { newControl.SetDataProfile(profile); } Destroy(this); }
//Set Delay Profile public void SetDataProfile(AIFighterData profile) { // Perlin Noise Variables this.perlinScale = profile.perlinScale; // Delay Variables this.thinkDelayMin = profile.thinkDelayMin; this.thinkDelayMax = profile.thinkDelayMax; // Distance Variation To Attack this.attackThreshold = profile.attackThreshold; // Variables this.evadeLimit = profile.evadeLimit; this.defenseLimit = profile.defenseLimit; this.attackLimit = profile.attackLimit; }