public void CreateOrb(OrbSkill skill) { nextObrBullet = Instantiate(prafabHolder.OrbBullet, player.GetShootPoint(ShootPointPosition.MID).position, Quaternion.identity); OrbController orbController = nextObrBullet.GetComponent <OrbController>(); orbController.skill = skill; orbController.caster = player; GameObject skillPrafab = prafabHolder.GetSkill(skill.skillName); OrbSkillController orbSkillControllerComponent = skill.GetComponent <OrbSkillController>(); OrbSkillController orbSkillController = (OrbSkillController)nextObrBullet.AddComponent(orbSkillControllerComponent.GetType()); orbSkillController.skill = skill; orbSkillController.creator = gameObject; orbController.orbSkillController = orbSkillController; //nextObrBullet.GetComponent<Bullet>().creator = gameObject; }
private GameObject AddSkillController(GameObject triggeredObject, ContactPoint contactPoint) { GameObject skillPrafab = prafabHolder.GetSkill(skill.skillName); OrbSkillController skillControllerPrafab = skill.GetComponent <OrbSkillController>(); GameObject skillHolder = Instantiate(prafabHolder.Skillholder, transform.position, Quaternion.identity);; OrbSkillController skillController = (OrbSkillController)skillHolder.AddComponent(skillControllerPrafab.GetType()); skillController.primaryTarget = triggeredObject; skillController.creator = caster.gameObject; skillController.skill = skill; skillController.primaryContactPoint = contactPoint; skillController.primaryTarget = triggeredObject; skillController.position1 = transform; orbSkillController = skillController; skill.skillControllerObj = skillHolder; return(skillHolder); }
private void StartOrbSkill(GameObject skillHolder, GameObject triggeredObject) { OrbSkillController skillController = skillHolder.GetComponent <OrbSkillController>(); skillController.InitialSkill(); }