Exemplo n.º 1
0
    void Awake()
    {
        if (null != CoverPrefab)
        {
            coverObj = Instantiate(CoverPrefab) as GameObject;
        }

        if (SkillCoverPrefab != null)
        {
            SkillcoverObj = Instantiate(SkillCoverPrefab) as GameObject;
        }

        if (null != coverObj)
        {
            coverObj.transform.AttachTo(transform, false);
            coverObj.transform.localPosition = new Vector3(0, 0, 1);
            coverObj.transform.localRotation = Quaternion.identity;

            coverMeshRender = coverObj.GetComponent <MeshRenderer>();
        }

        if (SkillcoverObj != null)
        {
            SkillcoverObj.transform.AttachTo(transform, false);
            SkillcoverObj.transform.localPosition = new Vector3(0, 0, 1);
            SkillcoverObj.transform.localRotation = Quaternion.identity;

            SkillcoverMeshRender = SkillcoverObj.GetComponent <MeshRenderer>();
            SkillcoverObj.SetActive(false);
        }

        FocusLayerValue = (int)(Mathf.Log(FocusLayer.value) / Mathf.Log(2));

        Mycamera = this.GetComponent <Camera>();
        someJS   = this.GetComponent <ScreenOverlay> ();
    }
Exemplo n.º 2
0
 public void SetSkillEvent(bool type)
 {
     coverObj.SetActive(!type);
     SkillcoverObj.SetActive(type);
 }