public override void Initialize(SkillShotBullet bullet)
    {
        base.Initialize(bullet);

        Rigidbody2D rigid = bullet.Source.GetComponentInParent <Rigidbody2D>();

        joint                 = rigid.gameObject.AddComponent <DistanceJoint2D>();
        joint.enabled         = false;
        joint.maxDistanceOnly = true;
        //joint.connectedBody = puckRigid;
        joint.enableCollision = true;

        GameObject selfSpawnedVisuals = SimplePool.Spawn(visualsPrefab);

        selfSpawnedVisuals.transform.SetParent(rigid.transform, false);
        selfVisuals = selfSpawnedVisuals.GetComponent <MindMergeVisuals>();
        //selfVisuals.target = puckRigid;
        selfVisuals.flowIn = false;

        GameObject otherSpawnedVisuals = SimplePool.Spawn(visualsPrefab);

        otherVisuals           = otherSpawnedVisuals.GetComponent <MindMergeVisuals>();
        otherVisuals.target    = rigid;
        otherVisuals.flowIn    = true;
        otherInterrupt         = otherSpawnedVisuals.AddComponent <InterruptableProxy>();
        otherInterrupt.source  = this;
        otherInterrupt.enabled = false;

        selfSpawnedVisuals.SetActive(false);
        otherSpawnedVisuals.SetActive(false);
    }
    public override void Initialize(SkillShotBullet bullet)
    {
        base.Initialize(bullet);

        Rigidbody2D rigid = bullet.Source.GetComponentInParent<Rigidbody2D>();
        joint = rigid.gameObject.AddComponent<DistanceJoint2D>();
        joint.enabled = false;
        joint.maxDistanceOnly = true;
        //joint.connectedBody = puckRigid;
        joint.enableCollision = true;

        GameObject selfSpawnedVisuals = SimplePool.Spawn(visualsPrefab);
        selfSpawnedVisuals.transform.SetParent(rigid.transform, false);
        selfVisuals = selfSpawnedVisuals.GetComponent<MindMergeVisuals>();
        //selfVisuals.target = puckRigid;
        selfVisuals.flowIn = false;

        GameObject otherSpawnedVisuals = SimplePool.Spawn(visualsPrefab);
        otherVisuals = otherSpawnedVisuals.GetComponent<MindMergeVisuals>();
        otherVisuals.target = rigid;
        otherVisuals.flowIn = true;
        otherInterrupt = otherSpawnedVisuals.AddComponent<InterruptableProxy>();
        otherInterrupt.source = this;
        otherInterrupt.enabled = false;

        selfSpawnedVisuals.SetActive(false);
        otherSpawnedVisuals.SetActive(false);
    }
 protected override void Start()
 {
     base.Start();
     action = GetComponentInParent<InputToAction>();
     Side side = GetComponentInParent<Stats>().side;
     instantiatedShot = Instantiate(shotPrefab).GetComponent<SkillShotBullet>();
     instantiatedShot.Initialize(side, this);
     instantiatedShot.Active = false;
 }
示例#4
0
    protected override void Start()
    {
        base.Start();
        action = GetComponentInParent <InputToAction>();
        Side side = GetComponentInParent <Stats>().side;

        instantiatedShot = Instantiate(shotPrefab).GetComponent <SkillShotBullet>();
        instantiatedShot.Initialize(side, this);
        instantiatedShot.Active = false;
    }
 public virtual void Initialize(SkillShotBullet bullet)
 {
     this.bullet = bullet;
 }
 public virtual void Initialize(SkillShotBullet bullet)
 {
     this.bullet = bullet;
 }