Пример #1
0
 public OpponentJoints(Rigidbody2D rigid, DistanceJoint2D joint, MindMergeVisuals selfVisuals, MindMergeVisuals otherVisuals)
 {
     this.rigid        = rigid;
     this.joint        = joint;
     this.selfVisuals  = selfVisuals;
     this.otherVisuals = otherVisuals;
 }
 public OpponentJoints(Rigidbody2D rigid, DistanceJoint2D joint, MindMergeVisuals selfVisuals, MindMergeVisuals otherVisuals)
 {
     this.rigid = rigid;
     this.joint = joint;
     this.selfVisuals = selfVisuals;
     this.otherVisuals = otherVisuals;
 }
    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);
    }
Пример #4
0
    protected override void Start()
    {
        Rigidbody2D rigid = GetComponentInParent <Rigidbody2D>();

        joint               = rigid.gameObject.AddComponent <DistanceJoint2D>();
        joint.enabled       = false;
        joint.connectedBody = puckRigid;
        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);

        otherSpawnedVisuals.transform.SetParent(puckRigid.transform, false);
        otherVisuals        = otherSpawnedVisuals.GetComponent <MindMergeVisuals>();
        otherVisuals.target = rigid;
        otherVisuals.flowIn = true;

        selfSpawnedVisuals.SetActive(false);
        otherSpawnedVisuals.SetActive(false);

        base.Start();
    }
    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()
    {
        Rigidbody2D rigid = GetComponentInParent<Rigidbody2D>();
        joint = rigid.gameObject.AddComponent<DistanceJoint2D>();
        joint.enabled = false;
        joint.connectedBody = puckRigid;
        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);
        otherSpawnedVisuals.transform.SetParent(puckRigid.transform, false);
        otherVisuals = otherSpawnedVisuals.GetComponent<MindMergeVisuals>();
        otherVisuals.target = rigid;
        otherVisuals.flowIn = true;

        selfSpawnedVisuals.SetActive(false);
        otherSpawnedVisuals.SetActive(false);

        base.Start();
    }