/// <summary> /// 實體化老鼠角色 /// </summary> /// <param name="bundle">實體化物件</param> /// <param name="parent">上層</param> /// <param name="name">名稱</param> /// <param name="sacle">縮放</param> /// <returns></returns>- public GameObject InstantiateActor(GameObject bundle, Transform parent, string name, Vector3 sacle) { _clone = Instantiate(bundle, parent, name, Vector3.zero, sacle, Vector2.zero, -1); _clone.SetActive(false); DepthManager.SwitchDepthLayer(_clone, parent, Global.MeunObjetDepth); _clone.SetActive(true); return(_clone); }
/// <summary> /// 當按下且移動時,產生Clone /// </summary> void Move2Clone() { _clone = (GameObject)Instantiate(gameObject); EnDisableBtn(_clone, false); _clone.transform.parent = transform.parent; _clone.transform.localPosition = _originPos; _clone.transform.localScale = transform.localScale; _clone.name = gameObject.name; _clone.tag = gameObject.tag; _depth = DepthManager.SwitchDepthLayer(gameObject, transform, Global.MeunObjetDepth); // 移動時深度提到最高防止遮擋 }