示例#1
0
        protected void Awake()
        {
            item   = this.GetComponent <Item>();
            module = item.data.GetModule <ItemModuleStasisRifle>();


            item.OnHeldActionEvent += OnHeldAction;

            animator = gameObject.GetComponent <Animator>();

            if (!animator)
            {
                Debug.LogError("No animator found");
            }

            if (item.GetComponent <ItemShooter.ItemShooter>())
            {
                shootController = item.GetComponent <ItemShooter.ItemShooter>();
                shootController.isShootingAllowed = false;
            }
            else
            {
                Debug.Log("ItemShooter not found");
            }

            lightBallVFX    = transform.Find("LightBallFX").GetComponent <ParticleSystem>();
            chargeSparksVFX = transform.Find("SparksFX").GetComponent <ParticleSystem>();
            chargeSFX       = transform.Find("ChargeSFX").GetComponent <AudioSource>();
        }
        protected void Start()
        {
            item   = this.GetComponent <Item>();
            module = item.data.GetModule <ItemModuleNecromancerScepter>();



            item.OnHeldActionEvent += OnHeldAction;

            if (item.GetComponent <ItemShooter.ItemShooter>())
            {
                shootController = item.GetComponent <ItemShooter.ItemShooter>();
                shootController.isShootingAllowed = false;
            }
            else
            {
                Debug.Log("ItemShooter not found");
            }

            animator = gameObject.GetComponentInChildren <Animator>();

            portal = transform.Find("Portal").gameObject;

            indicatorVFX = transform.Find("Indicator").GetComponent <ParticleSystem>();
            indicatorVFX.Stop();

            RetrieveCreatureData();

            Invoke("Activate", 1f);
        }
示例#3
0
        protected void Awake()
        {
            item = this.GetComponent <Item>();
            item.OnHeldActionEvent += OnHeldAction;
            blade      = item.transform.Find("Blade");
            movingPart = item.transform.Find("MovingPart");
            radius     = Vector3.Distance(blade.transform.position, movingPart.transform.position);
            if (item.GetComponent <ItemShooter.ItemShooter>())
            {
                shootController = item.GetComponent <ItemShooter.ItemShooter>();
                shootController.isShootingAllowed = false;
            }
            else
            {
                Debug.Log("ItemShooter not found");
            }

            changeSFX = item.transform.Find("ChangeSFX").GetComponent <AudioSource>();
            sparks    = item.transform.Find("Sparks").GetComponent <ParticleSystem>();
        }