Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        mSys         = TmSystem.instance;
        mGame        = GameScript.instance;
        mAnm         = GetComponent <TmSpriteAnim>();
        mAnm.enabled = false;
        mDefLocalPos = mDestLocalPos = transform.localPosition;
        mDefCol      = renderer.material.color;
        if ((transform.parent != null) && (transform.parent.tag == transform.tag))   // child
        {
            this.gameObject.collider.enabled = false;
            this.gameObject.renderer.enabled = true;
//			this.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        mSys           = TmSystem.instance;
        mGame          = GameScript.instance;
        mSelPosId      = Vector2.one * -1.0f;
        mTouchLocalPos = Vector2.one * -1.0f;
        mTouchEnable   = true;
        mTimer         = 0.0f;
        MeshFilter meshFilter = GetComponent <MeshFilter>();

        if ((meshFilter != null) && (meshFilter.mesh != null))
        {
            meshFilter.mesh = meshFilter.sharedMesh = TmUtils.CreateGridXY(MESH_W, MESH_H);
            mMesh           = meshFilter.mesh;
        }
        posPanelObj.transform.localScale = new Vector3(1.0f / MESH_W, 1.0f / MESH_H, 1.0f);
        mMesh = TmUtils.SetMeshColor(mMesh, new Color(0.2f, 0.5f, 0.2f, 0.2f));
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        _sys = TmSystem.instance;
        _sys.mw.setHitLayerMask(1 << LayerMask.NameToLayer("layerTouch"));

        _partsList = new List <MyParts>();
        XmlDocument doc  = new XmlDocument();
        TextAsset   data = Instantiate(Resources.Load(_xmlPath, typeof(TextAsset))) as TextAsset;

        doc.LoadXml(data.text);
        XmlNodeList nodeList = doc.SelectNodes("book/page");

        for (int ii = 0; ii < nodeList.Count; ++ii)
        {
            MyParts parts = createPartsFromNode(nodeList[ii], null);
            _partsList.Add(parts);
        }
        createPlayers();
    }
Ejemplo n.º 4
0
 void Awake()
 {
     if (m_Instance == null)
     {
         m_Instance = this;
         DontDestroyOnLoad(gameObject);
         for (int ii = 0; ii < SOUND_CH_NUM; ++ii)
         {
             sysAudioSource[ii]             = gameObject.AddComponent <AudioSource>();
             sysAudioSource[ii].volume      = 1.0f;
             sysAudioSource[ii].loop        = (ii == (int)SOUND_CH.BGM);
             sysAudioSource[ii].playOnAwake = false;
         }
         bool ret = loadSysData();
         if (!ret)
         {
             Debug.Log("NoSaveData");
         }
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 5
0
 void Awake()
 {
     if(m_Instance==null){
         m_Instance = this;
         DontDestroyOnLoad(gameObject);
         for(int ii = 0; ii < SOUND_CH_NUM; ++ii){
             sysAudioSource[ii] = gameObject.AddComponent<AudioSource>();
             sysAudioSource[ii].volume = 1.0f;
             sysAudioSource[ii].loop = (ii==(int)SOUND_CH.BGM);
             sysAudioSource[ii].playOnAwake = false;
         }
         bool ret = loadSysData();
         if(!ret) Debug.Log("NoSaveData");
     }else{
         Destroy(this.gameObject);
     }
 }