Пример #1
0
    public GameObject addEffect(string effect, bool sync = true)
    {
        GameObject go = ResFactory.getCacheEffect(effect, this.clientRunTime);

        go.transform.SetParent(Tools.FindChild2(sync ? "personEarth/personDirection/buff" : "personEarth/effect", this.gameObject).transform, false);
        return(go);
    }
Пример #2
0
    public override void init()
    {
        base.init();
        GameObject go = ResFactory.getCacheEffect(this._fightEntity.data["resId"].ToString(), this.clientRunTime);

        //GameObject go = ResFactory.instance.bean2;
        go.transform.SetParent(skewBody.transform, false);
        //this.name = ( (CallEntity)this._fightEntity ).index.ToString();
    }
Пример #3
0
    public GameObject addEffect(string res, Vector2D position, float scale = 1)
    {
        GameObject go = ResFactory.getCacheEffect(res, this.clientRunTime);

        if (null == go)
        {
            MediatorSystem.log("effectLost", res);
            Debug.Log("没有资源" + res);
            return(go);
        }
        go.transform.SetParent(this.effectLayer, false);
        go.transform.localPosition = ViewUtils.logicToScene(position, this.clientRunTime.mapData.earthRadius, this.clientRunTime.mapData);

        Vector3 v = new Vector3(this.transform.position.x, go.transform.position.y, this.transform.position.z);

        go.transform.LookAt(v);
        if (1 != scale)
        {
            GameObjectScaler.Scale(go, scale);
        }
        return(go);
    }