Ejemplo n.º 1
0
 public override void AddPropertyComp()
 {
     _mProperty            = U3DGameObject.AddComponent(typeof(MonsterProperty)) as MonsterProperty;
     _mProperty.FleetID    = _mData.FleetID;
     _mProperty.Name       = _mData.MonsterName;
     _mProperty.DialogText = _mData.MonsterDialog;
     _mProperty.ModelName  = _mData.ModelName;
 }
Ejemplo n.º 2
0
    public void RemoveTriggerCallback(TriggerBase.OnTriggerEvent trigger)
    {
        BattleTrigger battleTrigger = U3DGameObject.GetComponentInChildren(typeof(BattleTrigger)) as BattleTrigger;

        if (battleTrigger == null)
        {
            return;
        }

        battleTrigger.TriggerEnterEvents -= trigger;
    }
Ejemplo n.º 3
0
    private void InitTriggers()
    {
        Object     obj = Resources.Load("Common/DetectTrigger");
        GameObject go  = GameObject.Instantiate(obj) as GameObject;

        // Ensure the original offset
        Vector3    localPos = go.transform.position;
        Quaternion localRot = go.transform.rotation;

        go.name                    = "DetectTrigger";
        go.transform.parent        = U3DGameObject.transform;
        go.transform.localPosition = localPos;
        go.transform.localRotation = localRot;
        if (null != _mData)
        {
            go.transform.localScale *= _mData.DetectionRangeFactor;
        }

        obj = Resources.Load("Common/BattleTrigger");
        go  = GameObject.Instantiate(obj) as GameObject;
        // Ensure the original offset
        localPos                   = go.transform.position;
        localRot                   = go.transform.rotation;
        go.name                    = "BattleTrigger";
        go.transform.parent        = U3DGameObject.transform;
        go.transform.localPosition = localPos;
        go.transform.localRotation = localRot;
        BattleTrigger trigger = go.GetComponent <BattleTrigger>() as BattleTrigger;

        trigger.Radius = 100.0f;
        if (null != _mData)
        {
            go.transform.localScale *= _mData.BattleRangeFactor;
        }

        // VisibleTrigger
        _mVisibleTrigger = U3DGameObject.GetComponentInChildren <VisibleTrigger>() as VisibleTrigger;
    }