示例#1
0
        private void OnAttach()
        {
            BuffControllerMk2 buff = BuffControllerMk2.MakeNewIfNone(this.block.tank);

            buff.AddBuff(this);
            base.block.tank.AnchorEvent.Subscribe(new Action <ModuleAnchor, bool, bool>(this.OnAnchor));
        }
示例#2
0
        private void OnDetach()
        {
            BuffControllerMk2 buff = BuffControllerMk2.MakeNewIfNone(this.block.tank);

            buff.RemoveBuff(this);
            if (base.block.tank != null)
            {
                base.block.tank.AnchorEvent.Unsubscribe(new Action <ModuleAnchor, bool, bool>(this.OnAnchor));
            }
        }
        private void OnAttach()
        {
            /*ModuleWeaponGun guntest = base.block.GetComponent<ModuleWeaponGun>();
             * if (guntest)
             * {
             *  Console.WriteLine("Successfully got gun");
             * }*/

            /*TankBlock blocktest = ManSpawn.inst.GetBlockPrefab((BlockTypes)block.visible.ItemType);
             * if (blocktest.name == pointer.name)
             * {
             *  Console.WriteLine("Successfully got prefab");
             * }*/
            BuffControllerMk2 buff = BuffControllerMk2.MakeNewIfNone(this.block.tank);

            buff.AddBlock(pointer);
        }
示例#4
0
        private void OnAnchor(ModuleAnchor anchor, bool anchored, bool fromAfterTechPopulate)
        {
            BuffControllerMk2 buff = BuffControllerMk2.MakeNewIfNone(this.block.tank);
            List <string>     list = new List <string>();

            for (int i = 0; i < m_BuffPath.Length; i++)
            {
                if (m_NeedsToBeAnchored[i] == true)
                {
                    List <string> splitPath = m_BuffPath[i].Split('.').ToList();
                    Type          component = typeof(TankBlock).Assembly.GetType(splitPath[0]);
                    if (buff.pathToSegment.ContainsKey(m_BuffPath[i]) && buff.typeToBlock.ContainsKey(component))
                    {
                        buff.pathToSegment[m_BuffPath[i]].ManipulateObj(buff.typeToBlock[component], "UPDATE");
                    }
                }
            }
        }
        private void OnDetach()
        {
            BuffControllerMk2 buff = BuffControllerMk2.MakeNewIfNone(this.block.tank);

            buff.RemoveBlock(pointer);
        }