// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); isKickId = Animator.StringToHash("isKick"); meleeScript.meleeDamage = this.meleeDamage; meleeScript.gameObject.SetActive(false); weaponManage = GetComponent <WeaponManage>(); }
void Start() { Debug.Assert(m_Axe); Debug.Assert(m_Spear); Debug.Assert(m_Sword); m_inventory = new Inventory(); m_Craft = new CraftingEngine(); m_Weapons = new WeaponManage(); m_Weapons.addNewWeapon(new InventoryItem(ItemType.AXE)); m_Craft.m_Inventory = m_inventory; m_Craft.m_Weapons = m_Weapons; m_facing = FACING_RIGHT; changeWeapon(0); // initialize m_HealthSystemOBJ = SpriteManage.getNewHealth(); m_HealthSystemOBJ.SetActive(true); Debug.Assert(m_HealthSystemOBJ); initHealth(DEFAULT_HEALTH); spr = GetComponent <SpriteRenderer>(); m_currentAnimation = 0; m_currentFrame = 0; m_state = IDLE; m_cam = Camera.main; m_weaponDelay = 0; m_Side = ObjectSide.OUR_SIDE; // get uihandler GameObject i = GameObject.Find("Inventory"); Debug.Assert(i); m_UIhandler = i.GetComponent <UIHandler>(); Debug.Assert(m_UIhandler); //m_DefaultWeaponAngle = m_currentWeaponSprite.transform.eulerAngles.z; }