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); }