// Use this for initialization void Start() { if (characterType == null) { characterType = GetComponent <MindControlType>(); } ph = GameObject.Find("PlayHud").transform.GetComponent <HUDstate>(); if (characterType.GetComponent <MindControlType>()) { ph.Hypno(); } else if (characterType.GetComponent <TeleportType>()) { ph.Teleport(); } else if (characterType.GetComponent <BrawlerType>()) { ph.Hypno(); } else if (characterType.GetComponent <GunnerType>()) { ph.Hypno(); } animator = GetComponent <Animator>(); speed = characterType.GetMoveSpeed() + GlobalMoveSpeed.GetSpeedDelta(); prevPos = transform.position; hp = characterType.GetHP(); if (name != null) { name.text = characterType.name; } }
private void Awake() { motor = GetComponent <Rigidbody2D>(); joint = GetComponent <Joint2D>(); if (character != null) { currentMoveSpeed = character.GetMoveSpeed(); currentDashSpeed = character.GetDashSpeed(); currentDashLength = character.GetDashLength(); currentDashResetLength = character.GetDashResetLength(); } }