Ejemplo n.º 1
0
    private void SpawnCutTree()
    {
        if (this.cut)
        {
            return;
        }
        this.cut = UnityEngine.Object.Instantiate <GameObject>(this.NetworkPrefab, base.transform.position, base.transform.rotation);
        TreeHealth component = this.cut.GetComponent <TreeHealth>();

        component.LodEntity = base.entity;
        component.SetLodBase(this.lod);
        this.cut_chunks = (from x in this.cut.GetComponentsInChildren <TreeCutChunk>()
                           orderby int.Parse(x.transform.parent.gameObject.name)
                           select x).ToArray <TreeCutChunk>();
    }
Ejemplo n.º 2
0
    private void CutDownExplosion()
    {
        if (BoltNetwork.isRunning)
        {
            return;
        }
        this.Trunk = (GameObject)UnityEngine.Object.Instantiate(this.Trunk, base.transform.position, base.transform.rotation);
        if (!this.dontScaleTrunk)
        {
            this.Trunk.transform.localScale = base.transform.localScale;
        }
        TreeHealth component = this.Trunk.GetComponent <TreeHealth>();

        component.destroyCutChunks();
        component.SetLodBase(this.LodTree);
        component.CutDown();
        UnityEngine.Object.Destroy(base.gameObject);
    }
Ejemplo n.º 3
0
    public void DoSpawnCutTree()
    {
        if (BoltNetwork.isRunning)
        {
            return;
        }
        EventInstance windEvent = TreeWindSfx.BeginTransfer(base.transform);

        this.Trunk = (GameObject)UnityEngine.Object.Instantiate(this.Trunk, base.transform.position, base.transform.rotation);
        if (!this.dontScaleTrunk)
        {
            this.Trunk.transform.localScale = base.transform.localScale;
        }
        TreeHealth component = this.Trunk.GetComponent <TreeHealth>();

        component.SetLodBase(this.LodTree);
        UnityEngine.Object.Destroy(base.gameObject);
        PrefabId log = BoltPrefabs.Log;

        TreeWindSfx.CompleteTransfer(this.Trunk.transform, windEvent);
    }