Exemplo n.º 1
0
 public void Shoot(Transform target, float time)
 {
     gameObject.SetActive(true);
     transform.SetParent(GameSceneManager.GetNode <Transform>("MonsterGroup"), true);
     m_target       = target;
     m_speed        = distance.magnitude / time;
     m_isNullTarget = false;
 }
Exemplo n.º 2
0
    public void Shoot(float speed, int angle)
    {
        gameObject.SetActive(true);
        transform.SetParent(GameSceneManager.GetNode <Transform>("MonsterGroup"), true);
        m_speed = speed;
        Vector3 rotation = transform.rotation.eulerAngles;

        transform.rotation = Quaternion.Euler(rotation.x, rotation.y + angle, rotation.z);
        m_isNullTarget     = true;
    }
    public override float Damage(ModelAttackData data)
    {
        float percent = base.Damage(data);

        DebugTool.Log("ModelMonster::Damage " + m_healthPoint.ToString());
        if (m_target == null)
        {
            m_target = GameSceneManager.GetNode <Transform>(data.sender);
        }
        m_selectObj.SetActive(true);
        TimerManager.Register(1, () => m_selectObj.SetActive(false));
        return(percent);
    }
    public static void Open(string viewName, Action <GameObject> callback)
    {
        GameViewInfo viewInfo = GetViewInfo(viewName);

        AssetBundleManager.Load(viewInfo.AssetBundleName, viewInfo.Name,
                                (GameObject gameObj) => {
            GameObject view   = UnityEngine.Object.Instantiate(gameObj) as GameObject;
            GameObject parent = GameSceneManager.GetNode(viewInfo.ParentName);
            if (parent == null)
            {
                DebugTool.LogError(string.Format("view name : {0}, parent node name : {1} not exit", viewName, viewInfo.ParentName));
            }
            view.transform.SetParent(parent.transform, false);
            callback(view);
        }
                                );
    }